<!--#include("./header.html")-->
<p>{$lang->about_point_module}</p>
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
	<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form ruleset="insertConfig" action="./" method="post" class="form">
	<input type="hidden" name="module" value="point" />
	<input type="hidden" name="act" value="procPointAdminInsertConfig" />
	<fieldset>
		<h2 class="h2">{$lang->is_default}</h2>
		<ul>
			<li>
				<p class="q"><label for="max_level">{$lang->max_level}</label></p>
				<p class="a">
					<input type="text" value="{$config->max_level}" name="max_level" id="max_level" style="width:30px" />
					<span class="desc">{$lang->about_max_level}</span>
				</p>
			</li>
			<li>
				<p class="q"><label for="point_name">{$lang->point_name}</label></p>
				<p class="a">
					<input type="text" value="{$config->point_name}" name="point_name" id="point_name" style="width:30px" />
					<span class="desc">{$lang->about_point_name}</span>
				</p>
			</li>
			<li>
				<p class="q"><label>{$lang->give_point}</label></p>
				<p class="a">
					<input type="text" value="{$config->signup_point}" name="signup_point" id="signup_point" style="width:30px" /> : 
					<label for="signup_point">{$lang->point_signup}</label>
					<br />
					<input type="text" value="{$config->login_point}" name="login_point" id="login_point" style="width:30px" /> :
					<label for="login_point">{$lang->cmd_login}</label>
					<br />
					<input type="text" name="insert_document" value="{$config->insert_document}" id="insert_document" style="width:30px" /> :
					<label for="insert_document">{$lang->point_insert_document}</label>
					<br />
					<input type="text" name="insert_comment" value="{$config->insert_comment}" id="insert_comment" style="width:30px" /> :
					<label for="insert_comment">{$lang->point_insert_comment}</label>
					<br />
					<input type="text" name="upload_file" value="{$config->upload_file}" id="upload_file" style="width:30px" /> :
					<label for="upload_file">{$lang->point_upload_file}</label>
					<br />
					<input type="text" name="download_file" value="{$config->download_file}" id="download_file" style="width:30px" /> :
					<label for="download_file">{$lang->point_download_file}</label>
					<br />
					<input type="text" name="read_document" value="{$config->read_document}" id="read_document" style="width:30px" /> :
					<label for="read_document">{$lang->point_read_document}</label>
					<br />
					<input type="text" name="voted" value="{$config->voted}" style="width:30px" id="voted" /> :
					<label for="voted">{$lang->point_voted}</label>
					<br />
					<input type="text" name="blamed" value="{$config->blamed}" id="blamed" style="width:30px" /> :
					<label for="blamed">{$lang->point_blamed}</label>
				</p>
			</li>
			<li>
				<p class="q"><label for="level_icon">{$lang->level_icon}</label></p>
				<p class="a">
					<select name="level_icon" id="level_icon">
						<!--@foreach($level_icon_list as $key => $val)-->
						<option value="{$val}" selected="selected"|cond="$config->level_icon == $val">{$val}</option>
						<!--@end-->
					</select>
					<span class="desc">{$lang->about_level_icon}</span>
				</p>
			</li>
			<li>
				<p class="q"><label for="disable_download">{$lang->disable_download}</label></p>
				<p class="a">
					<input type="checkbox" name="disable_download" id="disable_download" value="Y" checked="checked"|cond="$config->disable_download=='Y'" />
					<span class="desc">{$lang->about_disable_download}</span>
				</p>
			</li>
			<li>
				<p class="q"><label for="disable_read_document">{$lang->disable_read_document}</label></p>
				<p class="a">
					<input type="checkbox" name="disable_read_document" id="disable_read_document" value="Y" checked="checked"|cond="$config->disable_read_document=='Y'" />
					<span class="desc">{$lang->about_disable_read_document}</span>
				</p>
			</li>
		</ul>
		<div class="btnArea">
			<span class="btn medium"><input type="submit" value="{$lang->cmd_save}" /></span>
		</div>
	</fieldset>
	<fieldset>
		<h2 class="h2">{$lang->point_link_group}</h2>
		<div class="table even">
			<table width="100%" border="1" cellspacing="0">
				<caption>
					{$lang->about_point_link_group}
					<span class="side">
						<input type="radio" name="group_reset" id="group_reset_y" value="Y" checked="checked"|cond="$config->group_reset != 'N'" /> 
						<label for="group_reset_y">{$lang->point_group_reset_and_add}</label>
						<input type="radio" name="group_reset" id="group_reset_n" value="N" checked="checked"|cond="$config->group_reset == 'N'" /> 
						<label for="group_reset_n">{$lang->point_group_add_only}</label>
					</span>
				</caption>
				<thead>
					<tr>
						<th>{$lang->member_group}</th>
						<th>{$lang->level}</th>
					</tr>
				</thead>
				<tbody>
					<tr loop="$group_list => $key,$val">
						<td><label for="point_group_{$key}">{$val->title}</label></td>
						<td><input type="text" value="{$config->point_group[$key]}" name="point_group_{$key}" id="point_group_{$key}" style="width:30px" /></td>
					</tr>
				</tbody>
			</table>
		</div>
		<div class="btnArea">
			<span class="btn medium"><input type="submit" value="{$lang->cmd_save}" /></span>
		</div>
	</fieldset>
	<fieldset>
{@$point_group = @array_flip($config->point_group)}
		<h2 class="h2">{$lang->level_point}</h2>
		<div class="table">
			<table width="100%" border="1" cellspacing="0">
				<caption>
					<span class="side">
						<label for="">{$lang->expression}</label>
						<input value="{$config->expression}" size="30" class="level_expression" />
						<button type="button" class="calc_point">{$lang->level_point_calc}</button> 
						<button type="button" class="calc_point _reset">{$lang->cmd_exp_reset}</button>
					</span>
				</caption>
				<tr>
					<th scope="col">{$lang->level}</th>
					<th scope="col">{$lang->level_icon}</th>
					<th scope="col">{$lang->point}</th>
					<th scope="col">{$lang->member_group}</th>
				</tr>
				<tr>
					<td>1</td>
					<td><img src="{getUrl()}/modules/point/icons/{$config->level_icon}/1.gif" alt="" /></td>
					<td><input type="text" name="level_step_1" value="{$config->level_step[1]}" style="width:40px;text-align:right" /> {$config->point_name}</td>
{@$point_group_item = $point_group[1]}
{@$title=array()}
<!--@if($point_group_item)-->
	<!--@if($config->group_reset != 'N')-->
	{@$title[0] = $group_list[$point_group_item.'']->title}
	<!--@else-->
	{@$title[] = $group_list[$point_group_item.'']->title}
	<!--@end-->
<!--@end-->
					<td>{implode(', ', $title)}</td>
				</tr>
				<!--@for($i=2;$i<=$config->max_level;$i++)-->
{@$point_group_item = $point_group[$i]}
<!--@if($point_group_item)-->
	<!--@if($config->group_reset != 'N')-->
	{@$title[0] = $group_list[$point_group_item.'']->title}
	<!--@else-->
	{@$title[] = $group_list[$point_group_item.'']->title}
	<!--@end-->
<!--@end-->
				<tr class="row{(($i-1)%2+1)}">
					<td>{$i}</td>
					<td><img src="{getUrl()}/modules/point/icons/{$config->level_icon}/{$i}.gif" alt="" /></td>
					<td><input type="text" id="level_step_{$i}" name="level_step_{$i}" value="{$config->level_step[$i]}" style="width:40px;text-align:right" /> {$config->point_name}</td>
					<td>{implode(', ', $title)}</td>
				</tr>
				<!--@end-->
			</table>
		</div>
		<div class="btnArea">
			<span class="btn medium"><input type="submit" value="{$lang->cmd_save}" /></span>
		</div>
	</fieldset>
	<fieldset>
		<h2 class="h2">{$lang->cmd_point_recal}</h2>
		<p>{$lang->about_cmd_point_recal}</p>
		<p id="pointReCal"></p>
		<div class="btnArea">
			<span class="btn medium"><input type="button" value="{$lang->cmd_point_recal}" onclick="doPointRecal(); return false;"/></span>
		</div>
	</fieldset>
</form>
